<template>
	<view>
		<view class="list" v-show="current === 0">
			<template v-for="item of replies">
				<topic-reply-item :key="item['id']" :item="item" />
			</template>
			<data-empty v-if="!replies.length" />
		</view>
		<view class="list" v-show="current === 1">
			<template v-for="item of topics">
				<topic-reply-item :key="item['id']" :item="item" />
			</template>
			<data-empty v-if="!topics.length" />
		</view>
	</view>
</template>

<script>
	export default {
		props: ['replies', 'topics'],
		data (){
			return {
				current: 0
			}
		},
		created (){
			this.$EventBus.$on('author_tabBar', (res) => {
				this.current = res
			})
		},
		beforeDestroy (){
			this.$EventBus.$off('author_tabBar')
		}
	}
</script>

<style>
	.list{
		background-color: #fff;
	}
</style>
